package com.itmk.business.transport.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itmk.business.transport.entity.Transport;
import com.itmk.business.transport.mapper.TransportMapper;
import com.itmk.business.transport.service.TransportService;
import com.itmk.vo.req.TransportReqVO;
import com.itmk.vo.resp.PageRespVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TransportServiceImpl extends ServiceImpl<TransportMapper, Transport>
implements TransportService {

    @Autowired
    private TransportMapper mapper;



//    获取物流列表的数据
    @Override
    public PageRespVO<Transport> getTransportsList(TransportReqVO vo) {
        List<Object> result=mapper.getTransportList(vo);
        List<Transport> transports=(List<Transport>)result.get(0);
        Integer total=((List<Integer>)result.get(1)).get(0);
        PageRespVO<Transport> pageRespVO=new PageRespVO<>();
        pageRespVO.setTotal(new Long(total));
        pageRespVO.setRecords(transports);
        return pageRespVO;
    }
}
